ABC157 C - Guess The Number
提出
code: python
n, m = map(int, input().split())
for i in sc:
if (numbers[i0-1] != -1 and numbers[i0-1] != i1): print(-1)
exit()
else:
print(-1)
exit()
for i in range(n):
for i in numbers:
print(i, end="")
解答
code: python
n, m = map(int, input().split())
for i in sc:
if (numbers[i0-1] != -1 and numbers[i0-1] != i1): print(-1)
exit()
else:
if (n != 1 and numbers0 == 0): print(-1)
exit()
if (n == 1 and numbers0 == 0): print(0)
exit()
if (n != 1 and numbers0 == -1): if (n == 1 and numbers0 == -1): print(0)
exit()
for i in range(1, n):
for i in numbers:
print(i, end="")
メモ
解答が0の時がコーナーケース
提出
code: python
n, m = list(map(int, input().split()))
if n == 2:
tmp.append(-1)
elif n == 3:
tmp.append(-1)
tmp.append(-1)
for s_c in sc:
if tmps-1 != -1 and tmps-1 != c: print(-1)
exit()
else:
if n == 1:
# print(0)
# else:
if n == 2:
print(-1)
exit()
print(int(str(tmp0) + str(tmp1))) if n == 3:
print(-1)
exit()
print(int(str(tmp0) + str(tmp1) + str(tmp2)))